from langchain.vectorstores import FAISS
from langchain_community.embeddings import ModelScopeEmbeddings

texts = [
    '在这里',
    '你好啊',
    '你叫什么名字'
]
model_id = "damo/nlp_corom_sentence-embedding_english-base"
embeddings_model = ModelScopeEmbeddings(model_id=model_id)

#存储库
db = FAISS.from_texts(
    texts,embeddings_model
)
#相关性查询
query = '在这里'
docs = db.similarity_search(query,k=2)
for doc in docs:
    print(doc.page_content)